package com.xyw.code.platform.common.entity.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * Created by xuyiwei on 2019/8/8.
 */
@Getter
@AllArgsConstructor
public enum CommonStatusEnum {

    NORMAL(0, "正常"),
    DELETE(1, "删除"),
    ;


    private int type;
    private String description;


    public static CommonStatusEnum valueOf(int type) {
        for(CommonStatusEnum typeVar : CommonStatusEnum.values()) {
            if(typeVar.getType() == type) {
                return typeVar;
            }
        }
        return  NORMAL;
    }
}
